GXCopyToInk
You can use theGXCopyToInk
function to create a copy of an existing ink object.
gxInk GXCopyToInk(gxInk target, gxInk source);
target
- A reference to the ink object to copy the
source
contents into. If you specifynil
for this parameter, theGXCopyToInk
function creates a new ink object.source
- A reference to the ink object whose contents you want to copy.
- function result
- A reference to the copy (that is, the target ink).
DESCRIPTION
TheGXCopyToInk
function copies the contents of an existing ink object to another, or it creates a new ink object and copies the contents of an existing ink object to it. The function copies the color, transfer mode, attributes, and tag list (but not the owner count) of the ink object specified by thesource
parameter into the ink object specified by thetarget
parameter. It clones, but does not copy, the tag objects in the tag list.If you specify
nil
for thetarget
parameter, theGXCopyToInk
function creates a new ink object and copies the source properties, including owner count and tag list, into it.You can use the
GXCopyToInk
function to create a copy of an ink object so you can modify it without changing the original.SPECIAL CONSIDERATIONS
If you specifynil
for thetarget
parameter and no error occurs, theGXCopyToInk
function creates an ink object; you are responsible for disposing of that object when you no longer need it.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory ink_is_nil SEE ALSO
To create a new ink that is a copy of the default ink instead of a copy of an existing ink, use theGXNewInk
function, described on page 5-56.To compare two ink objects, use the
GXEqualInk
function, described in the next section.